package cn.edu.scau.cmi.huangzhiyuan.db.client;

import cn.edu.scau.cmi.huangzhiyuan.db.listener.Listener;
import javafx.application.Application;
import javafx.application.Platform;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class Start extends Application{

	public static void main(String[] args) {
		launch(args);
	}

	@Override
	public void start(Stage primaryStage) throws Exception {
		MainPane mainPane = new MainPane();
		
		Listener.addListener(mainPane);
		
		Scene scene = new Scene(mainPane);
		
		primaryStage.setScene(scene);
		primaryStage.setTitle("实验七");
		primaryStage.setWidth(820);
		primaryStage.setHeight(600);
		primaryStage.show();
		
		// 设置关闭窗口后，暂停主线程所有事务
		// 放置界面关闭后，后台仍在运行事务
		primaryStage.setOnCloseRequest(event -> {
			Platform.exit();
            System.exit(0);
		});
	}

}
